package games.graphPath;

public final class GraphHuristic {

	public static int comapre(GraphPathAStarState starState, GraphPathAStarState other) {
		
		//simple heuristic: h(s) = the length of shortest path do dest.
		int gThis = starState.getCost(); 
		int hThis = starState.getCur().getDist();
		int fThis = gThis + hThis;
		
		int hOther = other.getCur().getDist();
		int gOther = other.getCost();
		int fOther = hOther + gOther;
		
		// if fOther<fThis , then fOther is better, so we return <0 
		return fThis- fOther;
	}

}
